/**
 * 2025/01/01 - 2025/12/31
 */
package com.snail.starter.cloud.configuration;

import com.snail.starter.cloud.tracing.TracingLogFilter;
import com.snail.starter.cloud.tracing.TracingOpentelemetryFilter;
import com.snail.starter.cloud.tracing.TracingSimpleFilter;
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.properties.OtelSpringProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * @author zgadmin
 * @date 2025/8/26 13:30
 *
 */
@Configuration
public class TracingAutoConfiguration {

    @Bean
    @ConditionalOnBean(OtelSpringProperties.class)
    TracingSimpleFilter tracingSimpleFilter() {
        return new TracingSimpleFilter();
    }

    @Bean
    @ConditionalOnMissingBean(OtelSpringProperties.class)
    TracingOpentelemetryFilter tracingOpentelemetryFilter() {
        return new TracingOpentelemetryFilter();
    }

    @Bean
    TracingLogFilter tracingLogFilter() {
        return new TracingLogFilter();
    }

}